package com.zyark.web.interceptor;



import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * ClassName: DataObjectMapper  解决Date类型返回json格式为自定义格式<br/>
 * Function:  <br/>
 * Reason:  <br/>
 * Date: 2017-06-08 15:30 <br/>
 *
 * @author Ku_ker
 * @version 1.0
 * @JDK 1.7
 */
public class DataObjectMapper extends ObjectMapper {

    public DataObjectMapper() {

//        CustomSerializerFactory factory = new CustomSerializerFactory();
//        factory.addGenericMapping(Date.class, new JsonSerializer<Date>() {
//            @Override
//            public void serialize(Date value, JsonGenerator jsonGenerator, SerializerProvider provider) throws
//                    IOException, JsonProcessingException {
//                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//                jsonGenerator.writeString(sdf.format(value));
//            }
//        });
//        this.setSerializerFactory(factory);
    }
}
